#!/usr/bin/perl
open(LD, "/etc/lsirc");
@ld = <LD>;
close(LD);

foreach $l ($ld) {
   $l =~ s/\r|\n//g;
   $l =~ s/\*|\t//g;
}

$ldid = $ld[0];
$lddev = $ld[1];
$ldname = $ld[2];
$initmark = $ld[3];

print $ldname;
#print "\n";
#print $
if($initmark) {
       $out = `echo 1,,83|sfdisk -uC --force --quiet $lddev 2>/dev/null`; 
       open(FH, ">/tmp/ldname");
       print FH $ldname;
       close(FH);
       $out = `dd if=/tmp/ldname of=$lddev bs=8 count=1 2>/dev/null`;
       unlink("/tmp/ldname");
}
